**Linking Individual and Group Motives for Violent Conflict
**September 2021
**Matthew Nanes
**matthew.nanes@slu.edu

use "IRQ_grievances_replication.dta", replace

label values econsat clear
label define degree_val 0 "Less than HS" 1 "HS" 2 "University" 3 "Masters/Law" 4 "Doctorate", replace
label values degree degree_val

foreach ivar in econsat degree {
	gen sun_`ivar' = sunni*`ivar'
	label variable sun_`ivar' "Sunni x `ivar'"
	}
	
foreach var in sun_econsat sun_degree econsat degree sunni male age {
	gen trt_`var' = listtreat*`var'
	}

tab PSU, gen(PSU)
foreach var in PSU1 PSU2 PSU3 PSU4 PSU5 PSU6 PSU7 PSU8 PSU9 PSU10 PSU11 PSU12 PSU13 PSU14 PSU15 PSU16 PSU17 PSU18 PSU19 PSU20 PSU21 PSU22 PSU23 PSU24 PSU25 PSU26 PSU27 PSU28 {
	gen trt_`var' = listtreat*`var'
	}

tab district, gen(dist)
foreach var in dist1 dist2 dist3 dist4 dist5 dist6 dist7 dist8 {
	gen trt_`var' = listtreat*`var'
	}

encode district, gen(district_n)

label variable trt_sun_econsat "Sunni x Econ. Satis."
label variable trt_sun_degree "Sunni x Educ. Degree"
label variable trt_male "Male"
label variable trt_age "Age"
label variable trt_sunni "Sunni"
label variable trt_econsat "Econ. Satis."
label variable trt_degree "Educ. Degree"
label variable listtreat "Long List" 


******************************************************************

**MAIN TEXT**

ssc install blindschemes
set scheme plotplainblind

*FIGURE 1
*Main results
*econsat
reg violence listtreat##c.econsat##sunni listtreat##c.male listtreat##c.age listtreat##i.district_n, cl(PSU)
qui margins, dydx(listtreat) at(econsat=(1(1)5) sunni=1) level(90) saving(econsat_sunni, replace)
qui margins, dydx(listtreat) at(econsat=(1(1)5) sunni=0) level(90) saving(econsat_shia, replace)
combomarginsplot econsat_sunni econsat_shia, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Economic Satisfaction") ytitle("Willingness to Use Violence") title("") xlabel(1(1)5) ylabel(-1(.5)1.5) saving(IRQ_violence_econsat.gph)
graph export "IRQ_motives_violence_mfx3.pdf", as(pdf) replace

*degree
reg violence listtreat##c.degree##sunni listtreat##c.male listtreat##c.age listtreat##i.district_n, cl(PSU)
qui margins, dydx(listtreat) at(degree=(0(1)4) sunni=1) level(90) saving(degree_sunni, replace)
qui margins, dydx(listtreat) at(degree=(0(1)4) sunni=0) level(90) saving(degree_shia, replace)
combomarginsplot degree_sunni degree_shia, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Highest Educational Degree") ytitle("Willingness to Use Violence") title("") xlabel(0(1)4) ylabel(-1(.5)1.5) saving(IRQ_violence_degree.gph)
graph export "IRQ_motives_violence_mfx4.pdf", as(pdf) replace

graph combine IRQ_violence_econsat.gph IRQ_violence_degree.gph, rows(2) xsize(4.5) ysize(5.6)
graph save Graph "IRQ_motives_violence_mfx2.gph", replace
graph export "IRQ_motives_violence_mfx2.eps", as(eps) replace
graph export "IRQ_motives_violence_mfx2.pdf", as(pdf) replace

foreach file in IRQ_violence_econsat.gph IRQ_violence_degree.gph econsat_sunni.dta econsat_shia.dta degree_sunni.dta degree_shia.dta {
	erase `file'
	}

**SUPPORTING INFO**

*Table 1: List Experiment Balance Table
ttest male, by(listtreat)
ttest age, by(listtreat)
ttest degree, by(listtreat)
ttest econsat, by(listtreat)
ttest electricity, by(listtreat)
ttest distshia, by(listtreat)

*By list experiment group
histogram degree if listtreat==0, discrete percent title(List Experiment Control) xtitle("") fcolor(gs10) legend(off) saving(hist_degree_cont.gph, replace)
histogram degree if listtreat==1, discrete percent title(List Experiment Treatment) xtitle("") fcolor(gs10) legend(off) saving(hist_degree_treat.gph, replace)
graph combine hist_degree_cont.gph hist_degree_treat.gph, title(Highest Earned Degree) rows(1) xsize(6.5) ysize(3)
graph save Graph "hist_degree_list.gph", replace
graph export "hist_degree_list.eps", as(eps) replace

histogram econsat if listtreat==0, discrete percent title(List Experiment Control) xtitle("") fcolor(gs10) legend(off) saving(hist_econsat_cont.gph, replace)
histogram econsat if listtreat==1, discrete percent title(List Experiment Treatment) xtitle("") fcolor(gs10) legend(off) saving(hist_econsat_treat.gph, replace)
graph combine hist_econsat_cont.gph hist_econsat_treat.gph, title(Economic Satisfaction) rows(1) xsize(6.5) ysize(3)
graph save Graph "hist_econsat_list.gph", replace
graph export "hist_econsat_list.eps", as(eps) replace

histogram electricity if listtreat==0, discrete percent title(List Experiment Control) ylabel(0(5)30) xtitle("") fcolor(gs10) legend(off) saving(hist_electricity_cont.gph, replace)
histogram electricity if listtreat==1, discrete percent title(List Experiment Treatment) ylabel(0(5)30) xtitle("") fcolor(gs10) legend(off) saving(hist_electricity_treat.gph, replace)
graph combine hist_electricity_cont.gph hist_electricity_treat.gph, title(Electricity (hours/day)) rows(1) xsize(6.5) ysize(3)
graph save Graph "hist_electricity_list.gph", replace
graph export "hist_electricity_list.eps", as(eps) replace

*By sect
histogram degree if sunni==0, discrete percent title(Shia) xtitle("") fcolor(gs10) legend(off) saving(hist_degree_shia.gph, replace)
histogram degree if sunni==1, discrete percent title(Sunni) xtitle("") fcolor(gs10) legend(off) saving(hist_degree_sunni.gph, replace)
graph combine hist_degree_shia.gph hist_degree_sunni.gph, title(Highest Earned Degree) rows(1) xsize(6.5) ysize(3)
graph save Graph "hist_degree_sect.gph", replace
graph export "hist_degree_sect.eps", as(eps) replace

histogram econsat if sunni==0, discrete percent title(Shia) xtitle("") fcolor(gs10) legend(off) saving(hist_econsat_shia.gph, replace)
histogram econsat if sunni==1, discrete percent title(Sunni) xtitle("") fcolor(gs10) legend(off) saving(hist_econsat_sunni.gph, replace)
graph combine hist_econsat_shia.gph hist_econsat_sunni.gph, title(Economic Satisfaction) rows(1) xsize(6.5) ysize(3)
graph save Graph "hist_econsat_sect.gph", replace
graph export "hist_econsat_sect.eps", as(eps) replace

histogram electricity if sunni==0, discrete percent title(Shia) ylabel(0(5)30) xtitle("") fcolor(gs10) legend(off) saving(hist_electricity_shia.gph, replace)
histogram electricity if sunni==1, discrete percent title(Sunni) ylabel(0(5)30) xtitle("") fcolor(gs10) legend(off) saving(hist_electricity_sunni.gph, replace)
graph combine hist_electricity_shia.gph hist_electricity_sunni.gph, title(Electricity (hours/day)) rows(1) xsize(6.5) ysize(3)
graph save Graph "hist_electricity_sect.gph", replace
graph export "hist_electricity_sect.eps", as(eps) replace


*Table 2: Distribution of List Experiment Responses
tab violence if listtreat==0
tab violence if listtreat==1

*Table 4: Support for Anti-Government Violence
ttest violence, by(listtreat)

*TABLE 5: Willing to Use Violence Against Government
eststo clear
eststo: reg violence trt_sun_econsat trt_sun_degree trt_male trt_age trt_sunni trt_econsat sun_econsat trt_degree sun_degree econsat degree sunni male age listtreat##i.district_n, cl(PSU)
eststo: reg violence trt_sun_econsat trt_sunni trt_econsat sun_econsat sunni econsat trt_male trt_age male age listtreat##i.district_n, cl(PSU)
eststo: reg violence trt_sun_degree trt_sunni trt_degree sun_degree sunni degree trt_male trt_age male age listtreat##i.district_n, cl(PSU)
eststo: ologit violence trt_sun_econsat trt_sunni trt_econsat sun_econsat sunni econsat trt_male trt_age male age listtreat##i.district_n, cl(PSU)
eststo: ologit violence trt_sun_degree trt_sunni trt_degree sun_degree sunni degree trt_male trt_age male age listtreat##i.district_n, cl(PSU)
esttab using "IRQ_grievances_2.tex", se r2 star(* .10 ** .05 *** .01) keep(1.listtreat trt*) nodep mtitle("" "" "" "" "") label title(Willing to Use Violence Against Government\label{tab:grievances2}) note(Models 1-3 OLS, 4-5 ordered logit. District FE and neighborhood-clustered SE.) replace 

*Figure 7: Impact of Economic and Political Experiences on Willingness to Use Violence
*Replicate main results figure using neighborhood instead of district FE
*econsat
reg violence listtreat##c.econsat##sunni listtreat##c.male listtreat##c.age listtreat##i.PSU, cl(PSU)
qui margins, dydx(listtreat) at(econsat=(1(1)5) sunni=1) level(90) saving(econsat_sunni, replace)
qui margins, dydx(listtreat) at(econsat=(1(1)5) sunni=0) level(90) saving(econsat_shia, replace)
combomarginsplot econsat_sunni econsat_shia, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Economic Satisfaction") ytitle("Willingness to Use Violence") title("") xlabel(1(1)5) ylabel(-1(.5)1.5) saving(IRQ_violence_econsat.gph)

*degree
reg violence listtreat##c.degree##sunni listtreat##c.male listtreat##c.age listtreat##i.PSU, cl(PSU)
qui margins, dydx(listtreat) at(degree=(0(1)4) sunni=1) level(90) saving(degree_sunni, replace)
qui margins, dydx(listtreat) at(degree=(0(1)4) sunni=0) level(90) saving(degree_shia, replace)
combomarginsplot degree_sunni degree_shia, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Highest Educational Degree") ytitle("Willingness to Use Violence") title("") xlabel(0(1)4) ylabel(-1(.5)1.5) saving(IRQ_violence_degree.gph)

graph combine IRQ_violence_econsat.gph IRQ_violence_degree.gph, rows(2) xsize(4.5) ysize(5.6)
graph save Graph "IRQ_motives_violence_comb_nbh2.gph", replace
graph export "IRQ_motives_violence_comb_nbh2.eps", as(eps) replace
graph export "IRQ_motives_violence_comb_nbh2.pdf", as(pdf) replace

foreach file in IRQ_violence_econsat.gph IRQ_violence_degree.gph econsat_sunni.dta econsat_shia.dta degree_sunni.dta degree_shia.dta {
	erase `file'
	}

*Does non-violent political participation correlate with grievance? 
cor violence econsat degree if listtreat==0

*FIGURE 8: Marginal effect of list experiment treatment across values of independent variables

ssc install interflex

rename PSU_N samplingunit
rename district samp_dist

interflex violence listtreat econsat male trt_male age trt_age dist* trt_dist* if sunni==1, cl(PSU) cut(1 2 3 4 5) title(Sunni) ylabel(Violence) xlabel(Economic Satisfaction) dlabel(List Treatment) yrange(-2 4) 
	graph save Graph "IRQ_mfx_econ_sun.gph", replace
interflex violence listtreat econsat male trt_male age trt_age dist* trt_dist* if sunni==0, cl(PSU) cut(1 2 3 4 5) title(Shia) ylabel(Violence) xlabel(Economic Satisfaction) dlabel(List Treatment) yrange(-2 4) 
	graph save Graph "IRQ_mfx_econ_shi.gph", replace
interflex violence listtreat degree male trt_male age trt_age dist* trt_dist* if sunni==1, cl(PSU) cut(0 1 2) title(Sunni) ylabel(Violence) xlabel(Highest Educational Degree) dlabel(List Treatment) yrange(-1 4) 
	graph save Graph "IRQ_mfx_degree_sun.gph", replace
interflex violence listtreat degree male trt_male age trt_age dist* trt_dist* if sunni==0, cl(PSU) cut(0 1 2) title(Shia) ylabel(Violence) xlabel(Highest Educational Degree) dlabel(List Treatment) yrange(-1 4) 
	graph save Graph "IRQ_mfx_degree_shi.gph", replace

graph combine IRQ_mfx_econ_sun.gph IRQ_mfx_econ_shi.gph IRQ_mfx_degree_sun.gph IRQ_mfx_degree_shi.gph, rows(2) xsize(6.5) ysize(4)

rename samplingunit PSU_N
rename samp_dist district

*FIGURE 9: Impact of Economic Satisfaction on Violent and Non-Violent Participation
reg violence listtreat##c.econsat##sunni listtreat##c.male listtreat##c.age listtreat##i.district_n, cl(PSU)
qui margins, dydx(listtreat) at(econsat=(1(1)5) sunni=1) level(90) saving(econsat_sunni, replace)
qui margins, dydx(listtreat) at(econsat=(1(1)5) sunni=0) level(90) saving(econsat_shia, replace)
combomarginsplot econsat_sunni econsat_shia, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Economic Satisfaction") ytitle("Willingness to Use Violence") title("") xlabel(1(1)5) ylabel(-1(1)2) saving(IRQ_violence_econsat.gph)

reg violence listtreat##c.econsat##sunni listtreat##c.male listtreat##c.age listtreat##i.district_n, cl(PSU)
qui margins, at(econsat=(1(1)5) sunni=1 listtreat==0) level(90) saving(econsat_sunni_nv, replace)
qui margins, at(econsat=(1(1)5) sunni=0 listtreat==0) level(90) saving(econsat_shia_nv, replace)
combomarginsplot econsat_sunni_nv econsat_shia_nv, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Economic Satisfaction") ytitle("Non-Violent Participation") title("") xlabel(1(1)5) ylabel(0(1)4) saving(IRQ_nv_econsat.gph)

graph combine IRQ_violence_econsat.gph IRQ_nv_econsat.gph, rows(1) xsize(6.5)
graph save Graph "IRQ_participation_comb2.gph", replace
graph export "IRQ_participation_comb2.eps", as(eps) replace
graph export "IRQ_participation_comb2.pdf", as(pdf) replace

foreach file in IRQ_violence_econsat.gph IRQ_nv_econsat.gph {
	erase `file'
	}
	
*FIGURE 10: Impact of Education on Violent and Non-Violent Participation
reg violence listtreat##c.degree##sunni listtreat##c.male listtreat##c.age listtreat##i.district_n, cl(PSU)
qui margins, dydx(listtreat) at(degree=(0(1)4) sunni=1) level(90) saving(degree_sunni, replace)
qui margins, dydx(listtreat) at(degree=(0(1)4) sunni=0) level(90) saving(degree_shia, replace)
combomarginsplot degree_sunni degree_shia, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Highest Educational Degree") ytitle("Willingness to Use Violence") title("") xlabel(0(1)4) ylabel(-1(1)2) saving(IRQ_violence_degree.gph)

reg violence listtreat##c.degree##sunni listtreat##c.male listtreat##c.age listtreat##i.district_n, cl(PSU)
qui margins, at(degree=(0(1)4) sunni=1 listtreat==0) level(90) saving(degree_sunni_nv, replace)
qui margins, at(degree=(0(1)4) sunni=0 listtreat==0) level(90) saving(degree_shia_nv, replace)
combomarginsplot degree_sunni_nv degree_shia_nv, labels("Sunni" "Shia") recastci(rarea) ciopt(color(%35)) xtitle("Highest Educational Degree") ytitle("Non-Violent Participation") title("") xlabel(0(1)4) ylabel(0(1)4) saving(IRQ_nv_degree.gph)

graph combine IRQ_violence_degree.gph IRQ_nv_degree.gph, rows(1) xsize(6.5)
graph save Graph "IRQ_participation_comb.gph", replace
graph export "IRQ_participation_comb.eps", as(eps) replace
graph export "IRQ_participation_comb.pdf", as(pdf) replace

foreach file in IRQ_violence_degree.gph IRQ_nv_degree.gph {
	erase `file'
	}

	